package com.boot.contorller;

import com.boot.result.Result;
import com.boot.service.UserService;
import com.boot.user.dto.DeduceDTO;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

@RestController
@RequestMapping("user")
@AllArgsConstructor
public class UserController {
    private UserService  userService;

    @GetMapping("/{id}")
    public Result getUserById(@PathVariable Long id) {
        return userService.getUserById(id);
    }

    @PostMapping("/deduce")
    public Result deduce(@RequestBody DeduceDTO deduceDTO) {
        return userService.deduce(deduceDTO);
    }
}
